import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpLecturer {
  id!: number;
  name!: string;
  img!: unknown;
  position?: string;
  phone!: string;
  sort: number = 0;
  state: boolean = true;
  uniacid!: number;
  content?: unknown;
  sex!: boolean;
  addTime!: string;
  updateTime!: string;
}

export const ImsYzdKpLecturerSchema = new EntitySchema({
  class: ImsYzdKpLecturer,
  properties: {
    id: { primary: true, type: 'number' },
    name: { type: 'string', length: 255 },
    img: { type: 'unknown', columnType: 'longtext' },
    position: { type: 'string', length: 255, nullable: true },
    phone: { type: 'string', length: 255 },
    sort: { type: 'number', default: 0, index: 'sort' },
    state: { type: 'boolean', default: true, index: 'state' },
    uniacid: { type: 'number', index: 'uniacid' },
    content: { type: 'unknown', columnType: 'longtext', nullable: true },
    sex: { type: 'boolean' },
    addTime: { type: 'string', length: 255 },
    updateTime: { type: 'string', length: 255 },
  },
});
